package other._1;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author mazouri
 * @create 2022-01-04 11:37
 */
public class Client {
    public static void main(String[] args) {
        List<Point> points = generatePoint(50);
        System.out.println("平面集: ");
        for (Point point : points) {
            System.out.println(point);
        }
        List<Line> bfBull = new ConvexHull().handle(points);
        System.out.println("蛮力算法求解的凸包：  ");
        for (Line line : bfBull) {
            System.out.println(line);
        }

        new ShowBull(points);
    }

    public static List<Point> generatePoint(int n) {
        Random random = new Random();
        List<Point> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            Point point = new Point();
            int max_x = 150;
            int min_y = 850;
            int randomX = random.nextInt(min_y) % (min_y - max_x + 1) + max_x;
            int randomY = random.nextInt(min_y) % (min_y - max_x + 1) + max_x;

            point.setX(randomX);
            point.setY(randomY);

            list.add(point);

        }
        return list;
    }
}
